blob: 427428051c81c33079b45cc77b384b5bbe11ac36 [file] [log] [blame]
ronkorving5a4ba022013-06-08 07:34:561<!doctype html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
Hallvord Reiar M. Steenee396df2013-06-10 13:27:405 <title>XMLHttpRequest: the LOADING state change should only happen once</title>
ronkorving5a4ba022013-06-08 07:34:566 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script>
Hallvord Reiar M. Steenee396df2013-06-10 13:27:408 <link rel="help" href="http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-send()-method" >
ronkorving5a4ba022013-06-08 07:34:569</head>
10
11<div id="log"></div>
12
13<script>
14
15var test = async_test();
16
17test.step(function() {
18 var client = new XMLHttpRequest();
19 var countedLoading = 0;
20
21 client.onreadystatechange = test.step_func(function() {
22 if (client.readyState === 3) {
23 countedLoading += 1;
24 }
25
26 if (client.readyState === 4) {
ronkorving05650d82013-06-08 07:36:4727 assert_equals(countedLoading, 1, "LOADING state change may only be emitted once");
ronkorving5a4ba022013-06-08 07:34:5628
29 test.done();
30 }
31 });
32
33 client.open("GET", "resources/trickle.php?count=1000");
34 client.send(null);
35});
36</script>